#!/bin/sh /etc/rc.common

START=10

disable_pihole() {
	local server=$1
	if [ "$(uci -q get openmptcprouter.${server}.pihole)" != "1" ] && [ "$(uci -q get dhcp.@dnsmasq[0].server)" = "/lan/ /use-application-dns.net/" ]; then
		_log "Disable Pi-Hole for boot..."
		uci -q batch <<-EOF >/dev/null
			add_list dhcp.@dnsmasq[0].server='127.0.0.1#5353'
			commit dhcp
		EOF
	fi
}


start()
{
	config_load openmptcprouter
	config_foreach disable_pihole_status server
}